package nacgraphs;

import java.awt.Color;
import java.awt.Paint;

public final class GraphEdge
{
    public static final Paint DEFAULT_COLOR = Color.BLACK;
    
    private static int _id = 0;
    private int id;
    private Paint color;
    private Student sourceStudent;
    private Student targetStudent;
    
    public GraphEdge()
    {
        this(null, null);
    }
    
    public GraphEdge(Student sourceStudent, Student targetStudent)
    {
        id = ++_id;
        color = DEFAULT_COLOR;
        
        this.sourceStudent = sourceStudent;
        this.targetStudent = targetStudent;
    }
    
    public int getId()
    {
        return id;
    }
    
    public Paint getColor()
    {
        return color;
    }
    
    public void setColor(Paint color)
    {
        this.color = color;
    }
    
    public Student getSourceStudent()
    {
        return sourceStudent;
    }
    
    public void setSourceStudent(Student sourceStudent)
    {
        this.sourceStudent = sourceStudent;
    }
    
    public Student getTargetStudent()
    {
        return targetStudent;
    }
    
    public void setTargetStudent(Student targetStudent)
    {
        this.targetStudent = targetStudent;
    }
    
    @Override
    public String toString()
    {
        return "E" + id;
    }
}
